package com.kapukapu.authorization.util;

import com.kapukapu.common.api.user.dto.AuthUserDTO;

/**
 * @author sivan
 * @email zifanuu@gmail.com
 */
public class UserInfoHodler {
	private static final ThreadLocal<AuthUserDTO> userInfo = new ThreadLocal<>();

	public static AuthUserDTO getUserInfo() {
		return userInfo.get();
	}

	public static void setUserInfo(AuthUserDTO userInfo) {
		UserInfoHodler.userInfo.set(userInfo);
	}

	public static void destroy() {
		UserInfoHodler.userInfo.set(null);
		UserInfoHodler.userInfo.remove();
	}
}
